<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>  </title>
    <style>
        .c1{
            width: 300px;
            height: 300px;
            background-color: red;
            position: fixed;
            left: 50%;
            top: 50%;
            /* margin-left: -150px;
            margin-top: -150px;       */
            transform: translate(-50%,-50%);    /*方块垂直水平居中*/
        }

        /* .c1:hover{
            transform: translate(50px,50px);
        } */

        .c2{
            width: 300px;
            height: 300px;
            margin: 80px;
            background-color: red;
            transform-origin: left bottom;  /*改变中心点位置  默认为center*/
        }

        .c2:hover{
            /* transform: scale(3);      缩放  小于1缩小 */
            transform: rotate(30deg);      /*旋转  */
            /* transform: skew(30deg);   倾斜变菱形 */
        }
    </style>
</head>
<body>
    <div class="c1"></div>
    <div class="c2"></div>
    
</body>
</html>